package com.seres.constant;

import lombok.Data;

/**
 * @Description : 消息通知
 * @ClassName : MessageNotify
 * @Author : 程磊
 * @Date: 2020-08-03 17:05
 */
@Data
public class MessageNotify {
    private String title;
    private String msg;
    public static MessageNotify format(MessageTemplateEnum templateEnum,Object ...params){
        MessageNotify notify = new MessageNotify();
        notify.setTitle(templateEnum.getTitle());
        if(params != null && params.length > 0) {
            notify.setMsg(String.format(templateEnum.getMsg(), params));
        }else{
            notify.setMsg(templateEnum.getMsg());
        }
        return notify;
    }
}
